package com.cdks.wuxiu.api.service.mysql;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdks.wuxiu.api.component.constant.Constant;
import com.cdks.wuxiu.api.mapper.MoodReplyInfoMapper;
import com.cdks.wuxiu.api.model.dto.MoodReplyInfoDTO;
import com.cdks.wuxiu.entity.mysql.MoodReplyInfo;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * 心情评论信息 服务实现类
 */
@Service
public class MoodReplyInfoServiceImpl extends ServiceImpl<MoodReplyInfoMapper, MoodReplyInfo> implements MoodReplyInfoService {

    @Override
    public List<MoodReplyInfoDTO> getList(long userId, long topicId, long fatherId, int type, int page) {
        List<MoodReplyInfoDTO> replyInfoList  = null;

        switch (type)
        {
            case Constant.REPLY_LIST_ALL:
            {
                replyInfoList  = baseMapper.getListAll(userId, topicId, fatherId, page * Constant.LIST_PAGE_SIZE, Constant.LIST_PAGE_SIZE);
                break;
            }

            case Constant.REPLY_LIST_MINE:
            {
                replyInfoList  = baseMapper.getListMine(userId, topicId, fatherId, page * Constant.LIST_PAGE_SIZE, Constant.LIST_PAGE_SIZE);
                break;
            }

            default:
            {
                break;
            }
        }

        return replyInfoList;
    }
}
